Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-milestone is "x-alarm-list">

With this node you can retrieve the list of alarms/events from the event server

Inputs

A JSON with these parameters:

hostname string
The hostname where the Event Server of Milestone VMS runs on. Only http or https are allowed(default localhost). (mandatory)
port number
The port that allows you to connect at the event server(default 22331). Check the XProtect documentation for more details. (mandatory)
maxLines number
Max lines of alarm to display from the event server (mandatory)
order string
The sorting type for the alarms.(Basically descending/ascending displayed in a drop-down menu in node properties). (mandatory)
target string
The target property of the sorting for the alarms.(They're displayed with a drop-down menu in node properties). (mandatory)

Outputs

A JSON array which contains an alarm for each item, if the node works, with these informations:

CameraId string
The Id of the camera corresponding to the alarm/event
Category number
The category of the alarm/event
CustomTag string
A tag associated with the alarm/event when it is triggered
Description string
A short description of the alarm/event
FilterMatch boolean
True or false, depending on the configuration of the filter
Id string
The Id associated with the alarm/event in the VMS
LocalId number
The relative Id associated with the alarm/event in the list
Location string
Where the alarm/event is located in the VMS
Message string
The message contained in the alarm/event when it triggered
Modified datetime
Timestamp when the alarm/event was modified last time
Name string
Name of the alarm/event in the VMS
Priority number
The priority level of the alarm/event in the VMS
Priority Name string
The priority associated at the priority number above
RuleType string
The type of the rule associated with the alarm/event in the VMS
SourceId string
The Id of the camera associated with the alarm/event in the VMS
SourceName string
The name of the camera associated with the alarm/event in the VMS
State number
The state of the alarm/event in the VMS when it triggered
StateName string
The name associated at the state number above
Timestamp datetime
Timestamp when the alarm/event was triggered
Type string
The type of alarm/event in the VMS
VendorName string
The vendor of the alarm/event in the VMS

A JSON object with these parameters, if the node doesn't work:

error string
The type of error generated by the operation
description string
A more accurate description to help resolve the issue

Example of JSON output if the operation works:

{
    Camerald: "ef06380b-88b8-4545-a93f-0e76b95b7434",
    Category: "0",
    CustomTag: "TagFromXML",
    Description: "test send event block-IJJ Analytics event description,
    FilterMatch: "true",
    Id: "ae5efc61-bb48-45dc-abd9-cbeba3a17660", 
    LocalId: "197", 
    Location: " Event location 1, 
    Message: "MyAnalyticsEvent01", 
    Modified: "2023-06-06716:58:00.59Z", 
    Name: "MyAnalyticsAlarm01", 
    Priority: "1", 
    PriorityName: "High", 
    RuleType: "4547f085-8b68-4639-826f-8722afbOffc5", 
    Sourceld: "ef06380b-88b8-4545-a93f-0e76b95b7434", 
    SourceName: "AXIS Q1951-E Thermal Camera (192.168.1.000) - Telecamera 1", 
    State: "1", 
    StateName: "New", 
    Timestamp: "2023-06- 06716:58:00.557Z", 
    Type: "MyType", 
    VendorName: "My Smart Video"
}
       

Example of JSON output if the operation goes wrong:

{
    error: "500 Internal Server Error",
    description: "The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://videoos.net/2/CentralServerAlarmCommand:maxCount. The InnerException message was 'There was an error deserializing the object of type System.Int32. The value " cannot be parsed as the type 'Int32'.'. Please see InnerException for more details." 
}
       

Details

The node can receive the parameters described in the Inputs section, with them generates a XML file with which a SOAP request is sent to the event server. A server response with the alarm list generates the output JSON. If the values are not present in the input JSON, these are read by those in the node properties. If they are not present in either part or are wrong, an error is generated for the necessary parameters or the reason why are not correct.